﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using DblogStudio.BLL;

namespace DblogStudio.DAL.Models
{
    public partial class LichBaoTri
    {
        public string _TenChiTietMay
        {
            get
            {
                var nv = BizChiTietMay.GetByID(MaChiTietMay);
                if (nv != null)
                    return nv.TenChiTietMay;
                else
                    return "";
            }
        }
        public string _TenNhiemVuBaoTri
        {
            get
            {
                var nv = BizNhiemVuBaoTri.GetByID(MaNhiemVuBaoTri);
                if (nv != null)
                    return nv.TenNhiemVuBaoTri;
                else
                    return "";
            }
        }
        public string _NgayBaoTri
        {
            get
            {
                return string.Format("{0:dd/MM/yyyy}", NgayBaoTri);
            }
        }
        public int _QuaHan
        {
            get
            {
                return DateTime.Now.Date.Subtract(NgayBaoTri.Date).Days;
            }
        }

    }
}
